﻿Imports Microsoft.Office.Interop.Outlook

Public Class pmNewContact
    Private _Email As String
    Private _app As Outlook.Application

    Public Sub New(ByVal App As Application, ByVal Email As String)
        _app = App
        InitializeComponent()
        _Email = Email

    End Sub

    Private Sub pmNewContact_Shown(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Shown
        txtEmail.Text = _Email
    End Sub

    Private Sub btnOK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOK.Click
        Dim valid As Boolean = True

        If txtAchternaam.Text = String.Empty Then
            valid = False
        End If
        If txtVoornaam.Text = String.Empty Then
            valid = False
        End If
        If txtBedrijf.Text = String.Empty Then
            valid = False
        End If
        If valid Then
            DialogResult = Windows.Forms.DialogResult.OK
          
            Me.Close()
        Else
            MessageBox.Show("Gelieve alle velden in te vullen.")
        End If
    End Sub
End Class